package com.wangyg.breadstore.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * Created by wangyg6 on 2019/5/13.
 * 使用@Entity, @Embeddable, or @MappedSuperclass注解的模型都会被jpa识别
 * 所有主配置(@EnableAutoConfiguration or @SpringBootApplication)下的包都会被扫描到
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@Builder
@ToString
@Table(appliesTo = "bread", comment = "面包")
@Entity
public class Bread {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;//id
	@Column
	private Integer breadId;//货号
	@Column
	private String name;//品名
	@Column
	private Long weight;//净重
	@Column
	private Boolean isWrappered;//散装or包装
	@Column()
	private Date createDate = new Date();
	@Column
	private Integer quantity;//数量
}
